﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace CommunitySystemModel
{
    public class DiaoDongModel
    {
        private int _Sec;
        [DataMember]
        public int Sec
        {
            get { return _Sec; }
            set { _Sec = value; }
        }
        private int _ID;
        [DataMember]
        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }
        private int _EmpbasicID;
        [DataMember]
        public int EmpbasicID
        {
            get { return _EmpbasicID; }
            set { _EmpbasicID = value; }
        }

        private string _Status = string.Empty;
        [DataMember]
        public string Status
        {
            get { return _Status; }
            set { _Status = value; }
        }

        private string _Type = string.Empty;
        [DataMember]
        public string Type
        {
            get { return _Type; }
            set { _Type = value; }
        }

        private DateTime? _RZQMSJ;
        [DataMember]
        public DateTime? RZQMSJ
        {
            get { return _RZQMSJ; }
            set { _RZQMSJ = value; }
        }

        private string _Name = string.Empty;
        [DataMember]
        public string Name
        {
            get { return _Name; }
            set { _Name = value; }
        }

        private string _CardNo = string.Empty;
        [DataMember]
        public string CardNo
        {
            get { return _CardNo; }
            set { _CardNo = value; }
        }

        private string _Gender = string.Empty;
        [DataMember]
        public string Gender
        {
            get { return _Gender; }
            set { _Gender = value; }
        }

        private string _OrgName = string.Empty;
        [DataMember]
        public string OrgName
        {
            get { return _OrgName; }
            set { _OrgName = value; }
        }

        private string _PositionName = string.Empty;
        [DataMember]
        public string PositionName
        {
            get { return _PositionName; }
            set { _PositionName = value; }
        }

        private string _DutyName = string.Empty;
        [DataMember]
        public string DutyName
        {
            get { return _DutyName; }
            set { _DutyName = value; }
        }

        private string _NewPositionName = string.Empty;
        [DataMember]
        public string NewPositionName
        {
            get { return _NewPositionName; }
            set { _NewPositionName = value; }
        }

        private string _NewDutyName = string.Empty;
        [DataMember]
        public string NewDutyName
        {
            get { return _NewDutyName; }
            set { _NewDutyName = value; }
        }

        private int _NewOrgID=0;
        [DataMember]
        public int NewOrgID
        {
            get { return _NewOrgID; }
            set { _NewOrgID = value; }
        }

        private string _NewOrgName = string.Empty;
        [DataMember]
        public string NewOrgName
        {
            get { return _NewOrgName; }
            set { _NewOrgName = value; }
        }

        private DateTime? _Birthday;
        [DataMember]
        public DateTime? Birthday
        {
            get { return _Birthday; }
            set { _Birthday = value; }
        }

        private string _DutyLevel = string.Empty;
        [DataMember]
        public string DutyLevel
        {
            get { return _DutyLevel; }
            set { _DutyLevel = value; }
        }

        private string _DutyAttribute = string.Empty;
        [DataMember]
        public string DutyAttribute
        {
            get { return _DutyAttribute; }
            set { _DutyAttribute = value; }
        }

        private string _TongYiStatus = string.Empty;
        [DataMember]
        public string TongYiStatus
        {
            get { return _TongYiStatus; }
            set { _TongYiStatus = value; }
        }

        private string _WorkCharge = string.Empty;
        [DataMember]
        public string WorkCharge
        {
            get { return _WorkCharge; }
            set { _WorkCharge = value; }
        }

        private DateTime? _JobDate = null;
        [DataMember]
        public DateTime? JobDate
        {
            get { return _JobDate; }
            set { _JobDate = value; }
        }

        private DateTime? _RXRZWSXSJ = null;
        [DataMember]
        public DateTime? RXRZWSXSJ
        {
            get { return _RXRZWSXSJ; }
            set { _RXRZWSXSJ = value; }
        }

        private int _OrgID=0;
        [DataMember]
        public int OrgID
        {
            get { return _OrgID; }
            set { _OrgID = value; }
        }

        private DateTime? _HuiYiDate;
        [DataMember]
        public DateTime? HuiYiDate
        {
            get { return _HuiYiDate; }
            set { _HuiYiDate = value; }
        }

        private DateTime? _LuYongDate;
        [DataMember]
        public DateTime? LuYongDate
        {
            get { return _LuYongDate; }
            set { _LuYongDate = value; }
        }

        private DateTime? _Begindate;
        [DataMember]
        public DateTime? Begindate
        {
            get { return _Begindate; }
            set { _Begindate = value; }
        }

        private DateTime? _Enddate;
        [DataMember]
        public DateTime? Enddate
        {
            get { return _Enddate; }
            set { _Enddate = value; }
        }


        private DateTime? _ZWCCSJ;
        [DataMember]
        public DateTime? ZWCCSJ
        {
            get { return _ZWCCSJ; }
            set { _ZWCCSJ = value; }
        }
        private DateTime? _ZWSXSJ;
        [DataMember]
        public DateTime? ZWSXSJ
        {
            get { return _ZWSXSJ; }
            set { _ZWSXSJ = value; }
        }
        private DateTime? _RQBegin;
        [DataMember]
        public DateTime? RQBegin
        {
            get { return _RQBegin; }
            set { _RQBegin = value; }
        }
        private DateTime? _RQEnd;
        [DataMember]
        public DateTime? RQEnd
        {
            get { return _RQEnd; }
            set { _RQEnd = value; }
        }
        private string _SYQ ;
        [DataMember]
        public string SYQ
        {
            get { return _SYQ; }
            set { _SYQ = value; }
        }
        private string _DiaoRuXingShi;
        [DataMember]
        public string DiaoRuXingShi
        {
            get { return _DiaoRuXingShi; }
            set { _DiaoRuXingShi = value; }
        }
        public static DiaoDongModel FillEntity(DataRow dr)
        {
            DiaoDongModel right = new DiaoDongModel();
            if (dr.Table != null && dr.Table.Columns.Contains("EmpbasicID")) if (!string.IsNullOrEmpty(dr["EmpbasicID"].ToString())) right.EmpbasicID = Convert.ToInt32(dr["EmpbasicID"]);
            if (dr.Table != null && dr.Table.Columns.Contains("ID")) right.ID = Convert.ToInt32(dr["ID"]);
            if (dr.Table != null && dr.Table.Columns.Contains("Status")) if (!string.IsNullOrEmpty(dr["Status"].ToString())) right.Status = dr["Status"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("RZQMSJ")) if (!string.IsNullOrEmpty(dr["RZQMSJ"].ToString())) right.RZQMSJ = Convert.ToDateTime(dr["RZQMSJ"]);
            if (dr.Table != null && dr.Table.Columns.Contains("Type")) if (!string.IsNullOrEmpty(dr["Type"].ToString())) right.Type = dr["Type"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("Name")) if (!string.IsNullOrEmpty(dr["Name"].ToString())) right.Name = dr["Name"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("OrgName")) if (!string.IsNullOrEmpty(dr["OrgName"].ToString())) right.OrgName = dr["OrgName"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("CardNo")) if (!string.IsNullOrEmpty(dr["CardNo"].ToString())) right.CardNo = dr["CardNo"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("Gender")) if (!string.IsNullOrEmpty(dr["Gender"].ToString())) right.Gender = dr["Gender"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("PositionName")) if (!string.IsNullOrEmpty(dr["PositionName"].ToString())) right.PositionName = dr["PositionName"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("DutyName")) if (!string.IsNullOrEmpty(dr["DutyName"].ToString())) right.DutyName = dr["DutyName"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("NewOrgID")) right.NewOrgID = Convert.ToInt32(dr["NewOrgID"]);
            if (dr.Table != null && dr.Table.Columns.Contains("NewPositionName")) if (!string.IsNullOrEmpty(dr["NewPositionName"].ToString())) right.NewPositionName = dr["NewPositionName"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("NewDutyName")) if (!string.IsNullOrEmpty(dr["NewDutyName"].ToString())) right.NewDutyName = dr["NewDutyName"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("NewOrgName")) if (!string.IsNullOrEmpty(dr["NewOrgName"].ToString())) right.NewOrgName = dr["NewOrgName"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("Birthday")) if (!string.IsNullOrEmpty(dr["Birthday"].ToString())) right.Birthday = Convert.ToDateTime(dr["Birthday"]);

            if (dr.Table != null && dr.Table.Columns.Contains("DutyLevel")) if (!string.IsNullOrEmpty(dr["DutyLevel"].ToString())) right.DutyLevel = dr["DutyLevel"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("DutyAttribute")) if (!string.IsNullOrEmpty(dr["DutyAttribute"].ToString())) right.DutyAttribute = dr["DutyAttribute"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("TongYiStatus")) if (!string.IsNullOrEmpty(dr["TongYiStatus"].ToString())) right.TongYiStatus = dr["TongYiStatus"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("WorkCharge")) if (!string.IsNullOrEmpty(dr["WorkCharge"].ToString())) right.WorkCharge = dr["WorkCharge"].ToString();

            if (dr.Table != null && dr.Table.Columns.Contains("JobDate")) if (!string.IsNullOrEmpty(dr["JobDate"].ToString())) right.JobDate = Convert.ToDateTime(dr["JobDate"]);
            if (dr.Table != null && dr.Table.Columns.Contains("RXRZWSXSJ")) if (!string.IsNullOrEmpty(dr["RXRZWSXSJ"].ToString())) right.RXRZWSXSJ = Convert.ToDateTime(dr["RXRZWSXSJ"]);
            if (dr.Table != null && dr.Table.Columns.Contains("OrgID")) if (!string.IsNullOrEmpty(dr["OrgID"].ToString())) right.OrgID = Convert.ToInt32(dr["OrgID"]);

            if (dr.Table != null && dr.Table.Columns.Contains("HuiYiDate")) if (!string.IsNullOrEmpty(dr["HuiYiDate"].ToString())) right.HuiYiDate = Convert.ToDateTime(dr["HuiYiDate"]);
            if (dr.Table != null && dr.Table.Columns.Contains("LuYongDate")) if (!string.IsNullOrEmpty(dr["LuYongDate"].ToString())) right.LuYongDate = Convert.ToDateTime(dr["LuYongDate"]);
            if (dr.Table != null && dr.Table.Columns.Contains("Begindate")) if (!string.IsNullOrEmpty(dr["Begindate"].ToString())) right.Begindate = Convert.ToDateTime(dr["Begindate"]);
            if (dr.Table != null && dr.Table.Columns.Contains("Enddate")) if (!string.IsNullOrEmpty(dr["Enddate"].ToString())) right.Enddate = Convert.ToDateTime(dr["Enddate"]);

            if (dr.Table != null && dr.Table.Columns.Contains("ZWCCSJ")) if (!string.IsNullOrEmpty(dr["ZWCCSJ"].ToString()) && Convert.ToDateTime(dr["ZWCCSJ"]) != Convert.ToDateTime("1900-01-01")) right.ZWCCSJ = Convert.ToDateTime(dr["ZWCCSJ"]);
            if (dr.Table != null && dr.Table.Columns.Contains("ZWSXSJ")) if (!string.IsNullOrEmpty(dr["ZWSXSJ"].ToString()) && Convert.ToDateTime(dr["ZWSXSJ"]) != Convert.ToDateTime("1900-01-01")) right.ZWSXSJ = Convert.ToDateTime(dr["ZWSXSJ"]);
            if (dr.Table != null && dr.Table.Columns.Contains("RQBegin")) if (!string.IsNullOrEmpty(dr["RQBegin"].ToString()) && Convert.ToDateTime(dr["RQBegin"]) != Convert.ToDateTime("1900-01-01")) right.RQBegin = Convert.ToDateTime(dr["RQBegin"]);
            if (dr.Table != null && dr.Table.Columns.Contains("RQBegin")) if (!string.IsNullOrEmpty(dr["RQBegin"].ToString()) && Convert.ToDateTime(dr["RQBegin"]) != Convert.ToDateTime("1900-01-01")) right.RQBegin = Convert.ToDateTime(dr["RQBegin"]);
            if (dr.Table != null && dr.Table.Columns.Contains("RQEnd")) if (!string.IsNullOrEmpty(dr["RQEnd"].ToString()) && Convert.ToDateTime(dr["RQEnd"]) != Convert.ToDateTime("1900-01-01")) right.RQEnd = Convert.ToDateTime(dr["RQEnd"]);
            if (dr.Table != null && dr.Table.Columns.Contains("SYQ")) if (!string.IsNullOrEmpty(dr["SYQ"].ToString())) right.SYQ = dr["SYQ"].ToString();
            if (dr.Table != null && dr.Table.Columns.Contains("DiaoRuXingShi")) if (!string.IsNullOrEmpty(dr["DiaoRuXingShi"].ToString())) right.DiaoRuXingShi = dr["DiaoRuXingShi"].ToString();
            return right;
        }
    }
}
